﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace Flagwind.Web.Plugins
{
	public class PluginWebFormViewEngine : PluginViewEngine
	{
		#region 构造方法

		public PluginWebFormViewEngine(Flagwind.Plugins.PluginContext pluginContext) : base(pluginContext)
		{
			this.ViewExtensions = new string[] { "aspx", "html", "htm" };
			this.PartialViewExtensions = new string[] { "ascx" };
			this.MasterExtensions = new string[] { "master" };
		}

		#endregion

		#region 创建视图

		protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath)
		{
			return new PluginWebFormView(this.PluginContext, viewPath, masterPath);
		}

		protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath)
		{
			return new PluginWebFormView(this.PluginContext, partialPath, null);
		}

		#endregion
	}
}
